<?php
namespace Jhub1_Admin\Controller\Plugin;

use Zend\Mvc\Controller\Plugin\AbstractPlugin;
use Zend\Http\Client;
use Zend\Session\Container;

class AuthenticationCheck extends AbstractPlugin
{
    private $userPO;

    public function __construct()
    {
        $session_user = new Container('user');
        $this->userPO = $session_user->offsetGet('userobject');
    }

    public function getUser()
    {
        $session_user = new Container('user');
        return $session_user->offsetGet('userobject');
    }

    public function isValid()
    {
        if (null != $this->userPO) {
            return true;
        } else {
            return false;
        }
    }

}
